package Frame;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JLabel;

/**
 * 实体设置选项
 */
public class FCEditBlockEntity extends JDialog {

	public FCEditBlockEntity(int x, int y, FCJtable jTable) {
		setBounds(0, 0, 200, 120);
		setLocationRelativeTo(null);
		setTitle("方块管理-实体坐标设置");
		setResizable(false);
		setModal(true);
		setLayout(null);

		JLabel jLabel = new JLabel("X:" + x + "  Y:" + y, JLabel.CENTER);
		jLabel.setBounds(0, 5, 200, 18);
		this.add(jLabel);

		JComboBox<String> jComboBox = new JComboBox<String>();
		jComboBox.setBounds(5, 30, 185, 20);
		jComboBox.addItem("0");// 人车皆可
		jComboBox.addItem("1");// 人可
		jComboBox.addItem("2");// 人车皆不可
		jComboBox.addItem("3");// 船可
		this.add(jComboBox);

		JButton jButton = new JButton("确认");
		jButton.setBounds(5, 55, 185, 18);
		this.add(jButton);

		jButton.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				jTable.addTexture(x + "," + y + "=" + jComboBox.getSelectedItem().toString());
				dispose();
			}
		});

		setVisible(true);
	}
}
